import request from '../../request/request.js'

//分页条件查询 全部试题
export function findAllQuestion(data){
    return request({
        url:'/question/question/findAllQuestion',
        method:'post',
        data
    })
}
//删除试题
export function questionDelete(qid){
    return request({
        url:'/question/question/questionDelete',
        method:'post',
        params:{
            qid:qid
        }
    })
}
//修改和创建试题
export function questionUpdate(data){
    return request({
        url:'/question/question/questionUpdate',
        method:'post',
        data
    })
}

//获取全部题型
export function findAllType(){
    return request({
        url:'/question/question/findAllType',
        method:'get'
    })
}

//获取班级树状结构
export function findAllLevel(){
    return request({
        url:'/question/question/findAllLevel',
        method:'get'
    })
}

// 提交word文件
export function redisToMysql(name,sid){
    return request({
        url:'/question/question/redisToMysql',
        method:'get',
        params:{
            fileName:name,
            subId:sid
        }
    })
}

// 导出word文件
export function download(data){
    return request({
        url:'/question/question/download-word',
        method:'post',
        responseType: 'blob',
        data
    })
}

export function addErrors(qid,uid){
    return request({
        url:'/question/question/addError',
        method:'post',
        data:{
            uid:uid,
            qid:qid
        }
    })
}


// 通过subid来随机生成考试题
export function addExaminationInformation(id){
    return request({
        url:'/question/question/addExaminationInformation',
        method:'get',
        params:{
            subId:id
        }
    })
}

// 老师提交申请修改题目
export function submitApplication(data){
    return request({
        url:'/groupOne/question/submitApplication',
        method:'post',
        data
    })
}

// 导出试题模版
export function outQuestionOne(){
    return request({
        url:'/question/question/outQuestionOne',
        method:'post',
        responseType: 'blob',
    })
}